'use strict';

const Service = require('egg').Service;

class HomeService extends Service {
  async helloWorld() {
    const data = await 'hellow world';
    return data;
  }

  async getGithubFollowers({ user, page, per_page }) {
    const res = await this.app.curl(`https://api.github.com/users/${user}/followers?page=${page}&per_page=${per_page}`, {
      dataType: 'json',
    });
    return res.data;
  }
}

module.exports = HomeService;
